From af0112f5c9b4042043f1fbb27a3693c22b78aeaf Mon Sep 17 00:00:00 2001 From: robertlipe Date: Tue, 23 Jul 2013 01:05:08 +0000 Subject: [PATCH] Gerhard gets QtCreator going for Windows, updates doc. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4467 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/GPSBabel.pro | 22 ++++++++++++++++++--- gpsbabel/jeeps/main.cc | 31 ------------------------------ gpsbabel/msvc/README.msvc | 40 ++++++++++++++++++++++++--------------- gpsbabel/msvc/config.h | 6 +++++- 4 files changed, 49 insertions(+), 50 deletions(-) diff --git a/gpsbabel/GPSBabel.pro b/gpsbabel/GPSBabel.pro index 6fd025ac1..dc3f5abdb 100644 --- a/gpsbabel/GPSBabel.pro +++ b/gpsbabel/GPSBabel.pro @@ -34,7 +34,7 @@ ALL_FMTS=$$MINIMAL_FMTS gtm.cc gpsutil.cc pcx.cc cetus.cc copilot.cc \ # ALL_FMTS=$$MINIMAL_FMTS FILTERS=position.cc radius.cc duplicate.cc arcdist.cc polygon.cc smplrout.cc \ reverse_route.cc sort.cc stackfilter.cc trackfilter.cc discard.cc \ - nukedata.cc interpolate.cc transform.cc height.cc swapdata.cc + nukedata.cc interpolate.cc transform.cc height.cc swapdata.cc bend.cc SHAPE=shapelib/shpopen.c shapelib/dbfopen.c pdbfile.cc @@ -62,13 +62,29 @@ SUBDIRS += jeeps macx|linux { DEFINES += HAVE_NANOSLEEP HAVE_LIBUSB HAVE_LIBEXPAT HAVE_GLOB DEFINES += HAVE_VA_COPY HAVE_VA_LIST_AS_ARRAY - SOURCES += gbser_posix.cc jeeps/gpslibusb.cc + SOURCES += gbser_posix.cc + JEEPS += jeeps/gpslibusb.cc INCLUDEPATH += jeeps LIBS += -lexpat } win32 { - SOURCES += gbser_win32.cc jeeps/gpsusbwin.c + DEFINES += __WIN32__ _CONSOLE + DEFINES -= -UNICODE -ZLIB_INHIBITED + DEFINES += HAVE_LIBEXPAT + CONFIG(debug, debug|release) { + DEFINES += _DEBUG + } + SOURCES += gbser_win.cc + JEEPS += jeeps/gpsusbwin.cc + INCLUDEPATH += msvc/expat + LIBS += ../gpsbabel/msvc/Expat/libexpat.lib setupapi.lib hid.lib + TEMPLATE=vcapp +} + +win32-msvc*{ + DEFINES += _CRT_SECURE_NO_DEPRECATE + QMAKE_CXXFLAGS += /MP } linux { diff --git a/gpsbabel/jeeps/main.cc b/gpsbabel/jeeps/main.cc index 128cbd2b7..e69de29bb 100644 --- a/gpsbabel/jeeps/main.cc +++ b/gpsbabel/jeeps/main.cc @@ -1,31 +0,0 @@ -#include "gps.h" -// #include "jeeps.h" - -main() -{ - int n; - GPS_PWay* way; - GPS_PWay* array; - - if (GPS_Init("/dev/ttyS0") < 0) { - fprintf(stderr, "Can't init\n"); - } - - if ((n=GPS_Command_Get_Waypoint("/dev/ttyS0", &way))<0) { - fprintf(stderr, "can't get\n"); - return; - } -// fprintf(stdout," Done\n"); - - GPS_Fmt_Print_Waypoint(way, n, stdout); - - array = (GPS_PWay*) calloc(1, sizeof(GPS_PWay)); - array[0] = GPS_Way_New(); - strcpy(array[0]->ident,"lower @#$%^&* rocks"); - strcpy(array[0]->cmnt,"COMMENTCOMMENTCOMMENTCOMMENTCOMMENT"); - array[0]->wpt_class = 0; - array[0]->lat = 1.234; - array[0]->lon = 1.234; - GPS_Command_Send_Waypoint("/dev/ttyS0", array, 1); - -} diff --git a/gpsbabel/msvc/README.msvc b/gpsbabel/msvc/README.msvc index d60611241..8f0acf431 100644 --- a/gpsbabel/msvc/README.msvc +++ b/gpsbabel/msvc/README.msvc @@ -1,27 +1,38 @@ -BUILDING GPSBABEL WITH Microsoft Visual Studio: +Building GPSBabel on Windows with QtCreator or Microsoft Visual Studio: -Microsoft Visual Studio (MSVS) support is provided for developers, not -intended for release builds or testing. Also, the MSVS project is enabled for +Windows build support is provided for developers, not currently intended +for release builds or testing. Also, the Windows native projects are normally enabled for the command line application only, not the GUI. -Note that the project is maintained separately from the regular build and is -not used by most regular GPSBabel developers. The project may not be updated -with for instance new formats. +These project files may not be actively maintained. Releases are built with mingw. + Note also that the Microsoft Visual C++ compiler (MSVC) is less standard compliant than other compilers and may require code modifications to compile. -Please share modifications and patches with the project. + +Qt: +To build you need Qt http://qt-project.com. While the regular GPSBabel build +uses Qt 4.6, it is possible to use the console application with Qt 5.1. + +QtCreator: +The GPSBabel.pro file is enabled also for Windows build in QtCreator. +To build you need to install a compiler (MS Visual Studio C++ or MinGW c/c++). +Just open the GPSBabel.pro file in QtCreator. + +If you prefer to use the MS Visual editor, you can generate a GPSBabel.vcxproj file. +To create the project, you can just open a command window, change directory to where you want to create the project file and type: +For example: ../../Qt/5.1.0/msvc2012/bin/qmake.exe gpsbabel/GPSBabel.pro + +Microsoft Visual Studio: +Note that the default project is maintained separately from the regular build and is +not used by most regular GPSBabel developers. The project may not be updated +with for instance new formats. The MSVS project is setup for MSVS2012. "Visual Studio Express 2012 for Windows Desktop" is available for free for non-commercial projects from Microsoft. The project file may be usable for MSVC2010 too (untested). Older versions may work with a modified project file. -The solution has three configurations: Debug, Release and Unicode. (Unicode -is similar to Release but sets XML_UNICODE=1, used by Google Earth.) -To build you need Qt http://qt-project.com. While the regular GPSBabel build -uses Qt 4.6, it is possible to use Qt5.1 with the MSVS. -You may use QtCreator to modify the project, or modify the project manually. You need to modify MSVS default or the GPSBabel project for Qt. The following are the default settings: * IncludePath (C:\Qt\5.1.0\msvc2012\include) @@ -29,6 +40,7 @@ are the default settings: In addition, if you are using Qt 4, change project properties: * Linker->Input->AdditionalIncludeDirectories from qt5core.lib to qtcore.lib. +Other libraries: Note that the "Microsoft Windows SDK" (previously "Microsoft Platform SDK") is required in addition to the actual compiler package for DeLorme (delbin). (Unless you have a special need for this format, it is simpler to patch the @@ -37,14 +49,12 @@ is required in addition to the actual compiler package for DeLorme (delbin). The "Expat" directory contains the import library and header file for the Expat DLL. +Running: To run GPSBabel, you must make sure that the dlls (Qt and libexpat.dll from the Expat directory) is in the DLL search path. The easiest way to do this, and to avoid version conflicts with other programs that use expat, is to put the dlls in the same directory as gpsbabel.exe. -Note that if you build with "normal" GPSBabel build method, you may get -compile errors as MSVS picks up incorrect config.h file. - If you experience any problems with this project file or with the build process, please ask for assistance on the gpsbabel-code mailing list at http://lists.sourceforge.net/lists/listinfo/gpsbabel-code diff --git a/gpsbabel/msvc/config.h b/gpsbabel/msvc/config.h index 9890bedb1..80d4a598e 100644 --- a/gpsbabel/msvc/config.h +++ b/gpsbabel/msvc/config.h @@ -1,3 +1,6 @@ +#if 0 +//This file is no longer used, the defines are set in the project files + #define HAVE_LIBEXPAT 1 #define __va_copy(ap1, ap2) ((ap1) = (ap2)) @@ -19,10 +22,11 @@ #define FILTERS_ENABLED 1 /* 1 to enable Palm PDB support */ -#define PDBFMTS_ENABLED 1 +#define PDBFMTS_ENABLED 1 /* 1 to enable shapefile support */ #define SHAPELIB_ENABLED 1 /* 1 to inhibit our use of zlib. */ #undef ZLIB_INHIBITED +#endif \ No newline at end of file -- 2.30.2